//
// Created by 1 on 2022/5/26.
//

#ifndef LAB5_KATERUTIL_H
#define LAB5_KATERUTIL_H
#include <string>
bool check_dig(std::string s){
    for(int i=0;i<s.size();i++){
        if(s[i]>'9'||s[i]<'0')return false;
    }
    return true;
}
int str_2_int(std::string s){
    if(s.size() > 10)return -1;
    int temp = 0;
    for(int i=0;i<s.size();i++){
        temp*=10;
        temp+=s[i]-'0';
    }
    std::cout<<temp<<std::endl;
    return temp;
}
#endif //LAB5_KATERUTIL_H
